/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package proyectoi.vista;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 *
 * @author User
 */
public class VentanaAplicacion extends JFrame {

    public VentanaAplicacion(String titulo) {
        super(titulo);

        ajustarComponentes(getContentPane());
        setSize(new Dimension(600, 400));
        //pack();
        setMinimumSize(getSize());
        setResizable(true);
        setLocationByPlatform(true);

        setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    private void ajustarComponentes(Container c) {
        ajustarMenus();
        c.setLayout(new BorderLayout());

        JPanel d = new JPanel();
        d.setBorder(BorderFactory.createLineBorder(Color.black));
        d.setLayout(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.insets = new Insets(4, 8, 4, 8);

        gbc.gridx = 0;
        gbc.gridy = 0;        
        d.add(new JLabel("Partidos:"), gbc);       
        gbc.gridx = 1;
        gbc.gridy = 0; 
        gbc.fill = GridBagConstraints.HORIZONTAL;        
        d.add(campoPartidos = new JTextField(), gbc);
        
        gbc.gridx = 0;
        gbc.gridy = 1;        
        d.add(new JLabel("Escaños:"), gbc);       
        gbc.gridx = 1;
        gbc.gridy = 1;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.weightx = 1.0;
        d.add(campoEscaños = new JTextField(), gbc);
        
        
        gbc.gridx = 1;
        gbc.gridy = 2;       
        d.add(actualizar = new JButton("actualizar"), gbc);
        
        
        

        c.add(BorderLayout.LINE_START, d);

    }

    private void ajustarMenus() {
    }

    public void init() {
        setVisible(true);
    }

    private JTextField campoEscaños;
    private JTextField campoPartidos;
    private JButton actualizar;
}
